﻿#ifndef UDPCHANNELFRM_H
#define UDPCHANNELFRM_H

#include <QWidget>

#include <net/netreading.h>

namespace Ui {
class UdpChannelFrm;
}

namespace QNET_NAMESPACE {
class UdpChannel;
}
QNET_USING_NAMESPACE

/**
 * @brief The UdpChannelFrm class udp通道测试窗口。
 */
class UdpChannelFrm : public QWidget,
        public NetReading
{
    Q_OBJECT

public:
    explicit UdpChannelFrm(QWidget *parent = nullptr);
    ~UdpChannelFrm() override;
    // NetReading interface
public:
    void onProc(const QByteArray &arry) override;

private:
    void setStopEnbale(bool enbale);
signals:
    void log_signal(QString msg);
private slots:
    void on_btnClearLog_clicked();

    void on_btnStart_clicked();
    void log_slot(QString msg);
    void on_btnSendData_clicked();

    void on_btnClearSend_clicked();

    void on_btnStop_clicked();

private:
    Ui::UdpChannelFrm *ui;
    QtSocket::UdpChannel *m_udpChannel;

};

#endif // UDPCHANNELFRM_H
